package com.platform.base.service.impl;

import java.util.List;
import java.util.Arrays;
import com.platform.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.platform.base.mapper.ValveTypeMapper;
import com.platform.base.domain.ValveType;
import com.platform.base.service.IValveTypeService;
import com.platform.common.core.text.Convert;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

/**
 * 阀门型号Service业务层处理
 * 
 * @author wangqi
 * @date 2020-09-25
 */
@Service
public class ValveTypeServiceImpl extends ServiceImpl<ValveTypeMapper,ValveType> implements IValveTypeService
{
    @Autowired
    private ValveTypeMapper valveTypeMapper;

    /**
     * 查询阀门型号列表
     * 
     * @param valveType 阀门型号
     * @return 阀门型号
     */
    @Override
    public List<ValveType> selectValveTypeList(ValveType valveType)
    {
        return valveTypeMapper.selectValveTypeList(valveType);
    }

    /**
     * 新增阀门型号
     * 
     * @param valveType 阀门型号
     * @return 结果
     */
    @Override
    public int insertValveType(ValveType valveType)
    {
        valveType.setCreateTime(DateUtils.getNowDate());
        return valveTypeMapper.insert(valveType);
    }

    /**
     * 修改阀门型号
     * 
     * @param valveType 阀门型号
     * @return 结果
     */
    @Override
    public int updateValveType(ValveType valveType)
    {
        valveType.setUpdateTime(DateUtils.getNowDate());
        return valveTypeMapper.updateById(valveType);
    }

    /**
     * 删除阀门型号对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteValveTypeByIds(String ids)
    {
        return valveTypeMapper.deleteBatchIds(Arrays.asList(Convert.toStrArray(ids)));
    }
}
